var cartId;
var titileReocord = "<span class='tt-inner' id='prescriptiontab'><img src='../resource/images/easyui/modem.png'/><br>订单商品</span>";
$(function() {
			/***用于查看信息详情**/
			$("#followTable").datagrid({
						onClickRow : function(rowIndex, rowData) {
							cartId = rowData.cartId;
						}
					});
		});

function addTabOutpatient(indexNo) {
	var row = $('#followTable').datagrid('getSelected');
	if (row) {
		var src=basePath+'clientService/clientServiceAction_toProducList.action?cartId='+cartId;
		var content = '<iframe scrolling="auto" frameborder="0"  src="'+src+'" style="width:100%;height:100%;"></iframe>';
		if (indexNo == 1) {
				$('#followProduct').tabs('add', {
					title : titileReocord,
					selected : true,
					closable:true,
					content:content
				});
		}
		if (indexNo == 2) {
			//$("#InpatientTableDialog").dialog("open");
		}//if

	} else {
		$.messager.alert('提示', '请选择一条数据!', 'info');
	}
	cartId="";
};

function getProductList(){
	$('#productTable').datagrid({
		url : basePath
				+ "clientService/clientServiceAction_getListProducts.action?cartId="+cartId
	});
}
 /** 重置订单搜索表单* */
	function resetForm() {
		$('#search').form('clear');
	}

/**搜索**/
function doSearch(){
	      $('#followTable').datagrid('load', {
	    	    recipientName : $('#clientNameSearch').val(),
	    	    recipientAddress : $('#clientAdressSearch').val(),
	    	    deliveryTime : $('#timeSearch').val()
			});
}